package com.example.superoa.model.pojos;

import java.io.Serializable;
import javax.persistence.*;
import java.util.Date;
import java.util.List;


/**
 * The persistent class for the activity database table.
 * 
 */
@Entity
@NamedQuery(name="Activity.findAll", query="SELECT a FROM Activity a")
public class Activity implements Serializable {
	private static final long serialVersionUID = 1L;

	@Id
	@Column(name="activity_id")
	private int activityId;

	@Column(name="act_static")
	private int actStatic;

	@Column(name="activity_address")
	private String activityAddress;

	@Temporal(TemporalType.TIMESTAMP)
	@Column(name="activity_end_time")
	private Date activityEndTime;

	@Column(name="activity_name")
	private String activityName;

	@Temporal(TemporalType.TIMESTAMP)
	@Column(name="activity_start_time")
	private Date activityStartTime;

	@Temporal(TemporalType.TIMESTAMP)
	@Column(name="activity_time")
	private Date activityTime;

	//bi-directional many-to-one association to Course
	@ManyToOne
	@JoinColumn(name="course_id")
	private Course course;

	//bi-directional many-to-many association to Trepeat
	@ManyToMany
	@JoinTable(
		name="bu_pei"
		, joinColumns={
			@JoinColumn(name="activity_id")
			}
		, inverseJoinColumns={
			@JoinColumn(name="trepeatid")
			}
		)
	private List<Trepeat> trepeats;

	//bi-directional many-to-one association to Record
	@OneToMany(mappedBy="activity")
	private List<Record> records;

	//bi-directional many-to-many association to Staff
	@ManyToMany(mappedBy="activities")
	private List<Staff> staffs;

	//bi-directional many-to-one association to Tasmission
	@OneToMany(mappedBy="activity")
	private List<Tasmission> tasmissions;

	//bi-directional many-to-one association to Tmark
	@OneToMany(mappedBy="activity")
	private List<Tmark> tmarks;

	public Activity() {
	}

	public int getActivityId() {
		return this.activityId;
	}

	public void setActivityId(int activityId) {
		this.activityId = activityId;
	}

	public int getActStatic() {
		return this.actStatic;
	}

	public void setActStatic(int actStatic) {
		this.actStatic = actStatic;
	}

	public String getActivityAddress() {
		return this.activityAddress;
	}

	public void setActivityAddress(String activityAddress) {
		this.activityAddress = activityAddress;
	}

	public Date getActivityEndTime() {
		return this.activityEndTime;
	}

	public void setActivityEndTime(Date activityEndTime) {
		this.activityEndTime = activityEndTime;
	}

	public String getActivityName() {
		return this.activityName;
	}

	public void setActivityName(String activityName) {
		this.activityName = activityName;
	}

	public Date getActivityStartTime() {
		return this.activityStartTime;
	}

	public void setActivityStartTime(Date activityStartTime) {
		this.activityStartTime = activityStartTime;
	}

	public Date getActivityTime() {
		return this.activityTime;
	}

	public void setActivityTime(Date activityTime) {
		this.activityTime = activityTime;
	}

	public Course getCourse() {
		return this.course;
	}

	public void setCourse(Course course) {
		this.course = course;
	}

	public List<Trepeat> getTrepeats() {
		return this.trepeats;
	}

	public void setTrepeats(List<Trepeat> trepeats) {
		this.trepeats = trepeats;
	}

	public List<Record> getRecords() {
		return this.records;
	}

	public void setRecords(List<Record> records) {
		this.records = records;
	}

	public Record addRecord(Record record) {
		getRecords().add(record);
		record.setActivity(this);

		return record;
	}

	public Record removeRecord(Record record) {
		getRecords().remove(record);
		record.setActivity(null);

		return record;
	}

	public List<Staff> getStaffs() {
		return this.staffs;
	}

	public void setStaffs(List<Staff> staffs) {
		this.staffs = staffs;
	}

	public List<Tasmission> getTasmissions() {
		return this.tasmissions;
	}

	public void setTasmissions(List<Tasmission> tasmissions) {
		this.tasmissions = tasmissions;
	}

	public Tasmission addTasmission(Tasmission tasmission) {
		getTasmissions().add(tasmission);
		tasmission.setActivity(this);

		return tasmission;
	}

	public Tasmission removeTasmission(Tasmission tasmission) {
		getTasmissions().remove(tasmission);
		tasmission.setActivity(null);

		return tasmission;
	}

	public List<Tmark> getTmarks() {
		return this.tmarks;
	}

	public void setTmarks(List<Tmark> tmarks) {
		this.tmarks = tmarks;
	}

	public Tmark addTmark(Tmark tmark) {
		getTmarks().add(tmark);
		tmark.setActivity(this);

		return tmark;
	}

	public Tmark removeTmark(Tmark tmark) {
		getTmarks().remove(tmark);
		tmark.setActivity(null);

		return tmark;
	}

}